from flask_script import Manager
from app import create_app
from model import db
from flask_migrate import Migrate, MigrateCommand

hyrzapp = create_app()
manager = Manager(hyrzapp)
migrate = Migrate(hyrzapp, db)

manager.add_command('db', MigrateCommand)

if __name__ == '__main__':
    manager.run()

# 启动
#   python manage.py runserver  -h 0.0.0.0 -p 8000 -d
# 进入app上下文环境测试
#   python manage.py shell

# 初始化迁移版本目录
# python manage.py db init
# python app.py db revision --rev-id <将提示的标识号填进这个位置>
# python manage.py db migrate  -- 生成版本
# python manage.py db upgrade  -- 生效到数据库
# 回滚 python manage.py db downgrade
